import service from "@/utils/request";

export default {
    /**
     * 上架商品
     * @param data
     * @returns {Promise<AxiosResponse<any>>}
     */
    putGoodsOn (data) {
        return service.post('/purchase/putGoodsOn', data)
    },

    /**
     * 查询正在售卖的商品
     */
    list (params) {
        return service.get('/purchase/queryGoods', { params })
    },

    /**
     * 获取商品类型
     */
    getTypeList (params) {
        return service.get('/purchase/getType', { params })
    },

    /**
     *  下架商品
     */
    deleteGoods (gid) {
        return service.get('/purchase/deleteGoods', {
            params: {gid}
        })
    },

    /**
     * 对商品补货
     */
    suppleGoods (data) {
        return service.post('/purchase/supplement', data)
    }
}